﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; Charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <title>选课推荐交流平台-选课推荐专栏</title>
    <meta name="keywords" content="longwang,龙旺博客,java学习"/>
    <link rel="shortcut icon" href="/static/foreground/images/logo.png" type="image/x-icon" />
    <!--Layui-->
    <link href="/static/foreground/layui/css/layui.css" rel="stylesheet" />
    <!--font-awesome-->
    <link href="/static/foreground/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <!--全局样式表-->
    <link href="/static/foreground/css/global.css" rel="stylesheet" />
    <link href="/static/foreground/css/animate.min.css" rel="stylesheet" />
    <!-- 本页样式表 -->
    <link href="/static/foreground/css/article.css" rel="stylesheet" />
    <link href="/static/css/blog.css" rel="stylesheet" />
    <link rel="stylesheet" href="/static/APlayer/APlayer.min.css">
</head>
<body>
    <!-- 导航 -->
    <div th:replace="common/head::#h"></div>
    <!-- 主体（一般只改变这里的内容） -->
    <div class="blog-body">
        <!-- 这个一般才是真正的主体内容 -->
        <div class="blog-container">
        	<blockquote class="layui-elem-quote sitemap layui-breadcrumb shadow">
                <a href="/" title="网站首页">网站首页</a>
                <a><cite>选课推荐专栏</cite></a>
        	</blockquote>
            <div class="blog-main">
                <!--左边笔记列表-->
                <div id="parentArticleList" class="blog-main-left animated slideInLeft">
                	
                </div>
                <!--右边小栏目-->
                <div class="blog-main-right">
                	<!-- 搜索 -->
                	<div class="blog-search animated fadeInRight">
	                        <div class="layui-form-item">
	                            <!-- <div class="search-keywords  shadow">
	                                <input type="text" id="keywords" name="keywords" th:value="${q }" lay-filter="searchInput" lay-verify="required" placeholder="输入关键词搜索" autocomplete="off" class="layui-input" />
	                            </div> 
	                            <div class="search-submit  shadow">
	                                <a class="search-btn" lay-submit="searchForm" lay-filter="searchForm"><i class="fa fa-search"></i></a>
	                            </div>-->
	                        </div>
	                </div>
                	<!-- 课程分类导航 -->
                	<div class="article-category shadow ">
                        <div class="article-category-title">课程分类导航</div>
                        	<a th:each="classify:${application.classifyList}" th:href="'javascript:classifyList('+${classify.classifyId}+');'" th:text="${classify.classifyName}"></a>
                        <div class="clear"></div>
                    </div>
                    <!--热文推荐/课程点击排行-->
                    <div class="layui-tab layui-tab-brief shadow animated fadeInRight" lay-filter="docDemoTabBrief">
						<ul class="layui-tab-title">
							<li class="layui-this">课程点击排行</li>
							<li>网页课程推荐</li>
						</ul>
  						<div class="layui-tab-content">
  							<div class="layui-tab-item layui-show">
	                        	<ul class="blog-module-ul">
		                            <li th:each="c,iterStat : ${application.clickArticleList}">
		                            	<span th:switch="${iterStat.count}">
		                            	<i th:case="'1'" class="layui-badge-rim layui-bg-red" th:text="${iterStat.count}"></i>
		                            	<i th:case="'2'" class="layui-badge-rim layui-bg-orange" th:text="${iterStat.count}"></i>
		                            	<i th:case="'3'" class="layui-badge-rim layui-bg-green" th:text="${iterStat.count}"></i>
		                            	<i th:case="*" class="layui-badge-rim" th:text="${iterStat.count}"></i>
										</span>
		                            	&nbsp;&nbsp;<a th:href="'/foreground/detail/'+${c.articleId}" th:text="${c.title}"></a>
		                           	</li>
		                        </ul>
	                        </div>
  							<div class="layui-tab-item">
		  						<ul class="blog-module-ul">
		  							<li th:each="r : ${application.recommendArticleList}">
										<span class="article_is_yc">原创</span>
		                            	&nbsp;&nbsp;<a th:href="'/foreground/detail/'+${r.articleId}" th:text="${r.title}"></a>
		                           	</li>
		                        </ul>
	                        </div>
  						</div>
					</div>
					<!--右边悬浮 平板或手机设备显示-->
                    <div class="category-toggle"><i class="fa fa-chevron-left"></i></div>  
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!-- 底部 -->
    <div th:replace="common/foot::#f"></div>
    <!--侧边导航-->
    <ul class="layui-nav layui-nav-tree layui-nav-side blog-nav-left layui-hide" lay-filter="nav">
        <li class="layui-nav-item">
            <a href="/"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
        </li>
        <li class="layui-nav-item">
            <a href="/foreground/article"><i class="fa fa-file-text fa-fw"></i>&nbsp;选课推荐专栏</a>
        </li>
        <li class="layui-nav-item">
            <a href="/foreground/mixed_pic"><i class="fa fa-paper-plane-o fa-fw"></i>&nbsp;杂七杂八</a>
        </li>
        <li class="layui-nav-item">
            <a href="/foreground/timeline"><i class="fa fa-road fa-fw"></i>&nbsp;点点滴滴</a>
        </li>
        <li class="layui-nav-item">
            <a href="/foreground/about"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>
        </li>
    </ul>

     
    <!--遮罩-->
    <div class="blog-mask animated layui-hide"></div>
    <!--Aplayer音乐播放器  -->
	
    <!-- jquery -->
    <script src="/static/foreground/js/jquery.min.js"></script>
    <!-- layui.js -->
    <script src="/static/foreground/layui/layui.js"></script>
    <!-- 全局脚本 -->
    <script src="/static/foreground/js/global.js"></script>
    <script src="/static/foreground/js/canvas-particle.js"></script>
	<!-- APlayer音乐播放器 -->
	<script src="/static/APlayer/APlayer.min.js"></script>
	
	<!-- 天气预报 -->
	<script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script>
	<script>tpwidget("init", {
	    "flavor": "bubble",
	    "location": "WSBQ3F31E8P0",
	    "geolocation": "enabled",
	    "position": "top-right",
	    "margin": "68px 30px",
	    "language": "zh-chs",
	    "unit": "c",
	    "theme": "chameleon",
	    "uid": "U1B01FCCC9",
	    "hash": "42ba05e92ec7ec1a1fe68b1e93b32f89"
	});
	tpwidget("show");</script>
	
	<script th:inline="javascript">
		/*<![CDATA[*/
			$(function(){
				$.ajax({
					url:"/foreground/musicList",
					dataType:"json",
					type:"post",
					success:function(data){
						if(data.success == 1){
							//初始化播放器
							const ap = new APlayer({
							    container: document.getElementById('aplayer'),
							    fixed: true,
							    autoplay: true,
							    audio: data.data
							});
						}else{
							layer.msg("音乐加载失败！");
						}
					}
				})
		    }) ;
		
		/*]]>*/ 
	</script>
	
    <script src="/static/js/blog.js"></script>
	<script type="text/javascript"> 
	//让选课推荐专栏在界面加载完毕选中
	    $(document).ready(function() {
	        $(".fa-file-text").parent().parent().addClass("layui-this");
	    });
	</script> 
	
	<script th:inline="javascript">
	/*<![CDATA[*/
		$(function(){
			var keywords=$("#keywords").val();
			if(keywords=="" || keywords==null){
				classifyList();//笔记列表遍历
			}
	    });
	
	/*]]>*/ 
</script>

<script th:inline="javascript">
	/*<![CDATA[*/
layui.use('form', function(){
	  var form = layui.form;
	form.on('submit(searchForm)', function(data){
		var keywords=$("#keywords").val();
		if(keywords==null || keywords==""){
			layer.msg('请输入要搜索的关键字');
			 return false;
		}
		$("#parentArticleList").empty();//移除 元素的内容：
		$("#parentArticleList").append("<div class=\"flow-default\" id=\"articleList\"></div>");
		layui.use('flow', function(){
			  var flow = layui.flow;
			  flow.load({
			    elem: '#articleList' //流加载容器
			    ,done: function(page, next){ //执行下一页的回调
			    	setTimeout(function(){
			    	$.post("/foreground/q",{page:page,q:$("#keywords").val()}, function(data) {
			    		 	var lis = [];
			    		 	if(data.total!=null || data.total!=0){
						        for(var i = 0; i < data.data.length; i++){
						          lis.push("<div class=\"article shadow animated zoomIn\">\n" + 
						  				"                		<div class=\"article-left \">\n" + 
										"                			<img src=\"/static/images/"+data.data[i].imageName+"\" alt=\""+data.data[i].title+"\"/>\n" + 
										"                		</div>\n" + 
										"                		<div class=\"article-right\">\n" + 
										"                        	<div class=\"article-title\">\n");
							          if(data.data[i].isTop==1){
							        	  lis.push("<span class=\"article_is_top\">置顶</span>&nbsp;");
							          }
							          if(data.data[i].isOriginal==1){
							        	  lis.push("<span class=\"article_is_yc\">原创</span>&nbsp;");
							          }else{
							        	  lis.push("<span class=\"article_is_zz\">转载</span>&nbsp;");
							          }
							   lis.push("                        		<a href=\"/foreground/detail/"+data.data[i].articleId+"\">"+data.data[i].title+"</a>\n" + 
										"                        	</div>\n" + 
										"                        	<div class=\"article-abstract\">\n" + 
										"                          	"+data.data[i].content+"</div>\n" + 
										"                        </div>\n" + 
										"                        <div class=\"clear\"></div>\n" + 
										"                        <div class=\"article-footer\">\n" + 
										"	                        <span><i class=\"fa fa-clock-o\"></i>&nbsp;&nbsp;"+data.data[i].publishDate+"</span>\n" + 
										"	                        <span class=\"article-author\"><i class=\"fa fa-user\"></i>&nbsp;&nbsp;' "+data.data[i].author+"</span>\n" + 
										"	                        <span><i class=\"fa fa-tag\"></i>&nbsp;&nbsp;<a href=\"javascript:classifyList("+data.data[i].classify.classifyId+");\"> "+data.data[i].classify.classifyName+"</a></span>\n" + 
										"	                        <span class=\"article-viewinfo\"><i class=\"fa fa-eye\"></i>&nbsp;"+data.data[i].click+"</span>\n" + 
										"	                        <span class=\"article-viewinfo\"><i class=\"fa fa-commenting\"></i>&nbsp;"+data.data[i].commentNum+"</span>\n" + 
										"                    	</div>\n" + 
										"                	</div>");
						        }
				    		
						        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
						        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
						        next(lis.join(''), page < data.totalPage);
			    		 	}
			        
			    	});
			    	});
			    }
			  });
			});
		  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
});
	/*]]>*/ 
</script>
</body>
</html>